Probability Distributions概率分布
Sub-topics 4.7, 4.8, 4.9 (SL core) and 4.11–4.13 (AHL — HL only) of IB AA HL Topic 4. Discrete random variables, binomial, normal, continuous RVs, linear transformations, sums of independent normals.
本单元覆盖 IB AA HL Topic 4 中的 4.7、4.8、4.9(SL 核心)与 4.11–4.13(AHL — 仅 HL)。内容包括离散随机变量(discrete random variable)、二项分布(binomial distribution)、正态分布(normal distribution)、连续随机变量(continuous random variable)、线性变换(linear transformation)和独立正态分布之和。
How to use this guide本指南使用说明
Read only the dashed-gold "Cram-Mode Cheat" box at the top of each section, plus the formula boxes. Memorize the unit cheat-sheet below. One sentence to carry: $E$ is the weighted mean, $\text{Var} = E(X^2) - \mu^2$, binomial means $np$, standardize normal with $Z = (X-\mu)/\sigma$. Skim one worked example per section. Do the unit quiz.
只看每节顶端的金色虚线 "Cram-Mode Cheat" 速记框,加上公式框(formula box)。把下面的单元小抄背下来。一句话总结:$E$ 是加权平均(expected value),$\text{Var} = E(X^2) - \mu^2$,二项分布(binomial distribution)均值是 $np$,正态用 $Z = (X-\mu)/\sigma$ 做标准化(standardization)。每节挑一道例题(worked example)扫一遍,做完单元测验即可。
Open every ▸ Going deeper. D3 is where IB pivots from "discrete counting" to distributional thinking. The big-3 HL ideas to internalize: (1) variance as a moment, (2) linear transformations on $E$ and $\text{Var}$, (3) sums of independent normals are normal. These three appear over and over in Paper 3.
把每个 ▸ Going deeper 折叠块都展开来读。D3 是 IB 从"离散计数"转向"分布思维"的关键节点。三个必须内化的 HL 重点:(1) 方差(variance)作为矩;(2) $E$ 与 $\text{Var}$ 上的线性变换(linear transformation);(3) 独立正态分布之和仍是正态。这三点会在 Paper 3 里反复出现。
variance),而不是标准差(standard deviation);许多教材采用 $N(\mu, \sigma)$ 的写法。使用时务必声明所用约定。图形计算器(GDC)几乎总要求输入 $\sigma$(标准差)而非 $\sigma^2$。
Unit D3 Cheat-SheetD3 单元小抄
Every formula in D3 fits on this single card. SL core on the left, HL-only on the right. If you only have ten minutes before the exam, memorize this.
D3 所有公式压缩在这张卡片上。左边是 SL 核心,右边是 HL 专属。考前只剩十分钟,就背这一张。
Discrete RV mean:离散随机变量的均值:
$$ E(X) = \sum x_i\, P(X = x_i). $$Binomial $X \sim B(n, p)$:二项分布 $X \sim B(n, p)$:
$$ P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}, $$ $$ E(X) = np, \qquad \text{Var}(X) = np(1-p). $$Normal $X \sim N(\mu, \sigma^2)$:正态分布 $X \sim N(\mu, \sigma^2)$:
$$ Z = \frac{X - \mu}{\sigma} \sim N(0, 1). $$68 / 95 / 99.7 within $\pm 1\sigma / 2\sigma / 3\sigma$. GDC: normCdf(a, b, μ, σ), invNorm(p, μ, σ).
68-95-99.7 法则(empirical rule)对应 $\pm 1\sigma / 2\sigma / 3\sigma$。GDC:normCdf(a, b, μ, σ)、invNorm(p, μ, σ)。
Variance (definition):方差(定义):
$$ \text{Var}(X) = E(X^2) - [E(X)]^2. $$Linear transformation:线性变换:
$$ E(aX + b) = aE(X) + b, $$ $$ \text{Var}(aX + b) = a^{2}\, \text{Var}(X). $$Sum / difference, indep. RVs:独立随机变量之和 / 之差:
$$ E(X \pm Y) = E(X) \pm E(Y), $$ $$ \text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y). $$Sum of independent normals:独立正态分布之和:
$$ X \sim N(\mu_1, \sigma_1^2),\; Y \sim N(\mu_2, \sigma_2^2) \;\Longrightarrow\; X + Y \sim N(\mu_1 + \mu_2,\; \sigma_1^2 + \sigma_2^2). $$probability density function / PDF)满足 $f(x) \ge 0$ 与 $\int_{-\infty}^{\infty} f(x)\,dx = 1$。概率、均值、方差和中位数(median)都用积分表达:
$$ P(a \le X \le b) = \int_{a}^{b} f(x)\,dx, \quad E(X) = \int_{-\infty}^{\infty} x\, f(x)\, dx, $$
$$ \text{Var}(X) = \int_{-\infty}^{\infty} x^{2}\, f(x)\, dx - \mu^{2}, \quad \int_{-\infty}^{m} f(x)\,dx = \tfrac{1}{2}. $$
3.1 Discrete Random Variables3.1 离散随机变量 SL 4.7
discrete random variable)$X$ 取一组取值 $x_1, x_2, \ldots$,对应概率 $P(X = x_i)$ 之和为 $1$。
所有 (取值, 概率) 对组成的列表就是 $X$ 的概率分布(probability distribution)。两条不可妥协的公理:
$$ P(X = x_i) \ge 0, \qquad \sum_{i} P(X = x_i) = 1. $$
一张表是不是真正的概率分布,只需要核对这两条规则。
random variable)本质上是一个把实验结果映射到数字的函数。掷骰子时,令 $X$ = 朝上面的点数,这就是一个离散随机变量,取值集合为 $\{1, 2, 3, 4, 5, 6\}$,每个值的概率都是 $\tfrac{1}{6}$。分布本身并不关心每个结果为何具有那种概率 — 它只关心值和概率是什么。这种抽象正是同一套工具能同时处理骰子、抛硬币、服务器请求和考试成绩的原因。
Worked Example — Verifying a distribution例题 — 验证一个分布
Problem: The random variable $X$ has distribution $P(X = 0) = 0.1$, $P(X = 1) = k$, $P(X = 2) = 0.3$, $P(X = 3) = 0.2$. Find $k$ and then compute $P(X \ge 2)$.
Apply $\sum P = 1$:
$$ 0.1 + k + 0.3 + 0.2 = 1 \;\Longrightarrow\; k = 0.4. $$Now sum the events $X = 2$ and $X = 3$:
$$ P(X \ge 2) = 0.3 + 0.2 = 0.5. $$题目:随机变量 $X$ 的分布为 $P(X = 0) = 0.1$,$P(X = 1) = k$,$P(X = 2) = 0.3$,$P(X = 3) = 0.2$。 求 $k$,并计算 $P(X \ge 2)$。
应用 $\sum P = 1$:
$$ 0.1 + k + 0.3 + 0.2 = 1 \;\Longrightarrow\; k = 0.4. $$对 $X = 2$ 和 $X = 3$ 两个事件求和:
$$ P(X \ge 2) = 0.3 + 0.2 = 0.5. $$Worked Example — Distribution from a rule例题 — 由规则给出的分布
Problem: A discrete RV $X$ has $P(X = x) = c \cdot x$ for $x \in \{1, 2, 3, 4\}$ and $0$ elsewhere. Find $c$ and tabulate the distribution.
Sum the probabilities and set equal to $1$:
$$ c(1 + 2 + 3 + 4) = 10 c = 1 \;\Longrightarrow\; c = \tfrac{1}{10}. $$Distribution:
| $x$ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| $P(X = x)$ | $0.1$ | $0.2$ | $0.3$ | $0.4$ |
题目:离散随机变量 $X$ 满足 $P(X = x) = c \cdot x$,其中 $x \in \{1, 2, 3, 4\}$,其余取值概率为 $0$。求 $c$ 并列出分布表。
把全部概率相加并令其等于 $1$:
$$ c(1 + 2 + 3 + 4) = 10 c = 1 \;\Longrightarrow\; c = \tfrac{1}{10}. $$分布表:
| $x$ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| $P(X = x)$ | $0.1$ | $0.2$ | $0.3$ | $0.4$ |
▸ Going deeper — Cumulative distribution function (CDF)▸ 深入 — 累积分布函数(CDF)
For a discrete RV $X$, the cumulative distribution function (CDF) is
$$ F(x) = P(X \le x) = \sum_{x_i \le x} P(X = x_i). $$It's a non-decreasing step function from $0$ to $1$. Two facts the IB occasionally tests:
- $P(a < X \le b) = F(b) - F(a)$ — careful with strict vs. weak inequalities for discrete RVs.
- $P(X \ge k) = 1 - F(k - 1)$ — the "$1$ minus CDF" trick is the standard route for tail probabilities, especially with binomial on the GDC.
On a GDC, binomCdf(n, p, k) returns $P(X \le k)$ for $X \sim B(n, p)$. To get $P(X > k)$, compute 1 − binomCdf(n, p, k); to get $P(X \ge k)$, compute 1 − binomCdf(n, p, k − 1).
对离散随机变量 $X$,累积分布函数(cumulative distribution function / CDF)定义为
$F$ 是从 $0$ 上升到 $1$ 的非递减阶梯函数。IB 偶尔会考的两件事:
- $P(a < X \le b) = F(b) - F(a)$ — 离散随机变量的严格不等号与非严格不等号必须分清。
- $P(X \ge k) = 1 - F(k - 1)$ — "$1$ 减 CDF"的技巧是处理尾部概率的标准套路,尤其是用 GDC 算二项分布时。
在图形计算器(GDC)上,binomCdf(n, p, k) 返回 $X \sim B(n, p)$ 时的 $P(X \le k)$。要算 $P(X > k)$,用 1 − binomCdf(n, p, k);要算 $P(X \ge k)$,用 1 − binomCdf(n, p, k − 1)。
3.2 Expected Value $E(X)$3.2 期望值 $E(X)$ SL 4.7
expected value)就是用概率加权得到的取值平均。
$$ E(X) = \mu = \sum_{i} x_i\, P(X = x_i). $$
$E(X)$ 是长期平均 — 把同一个实验重复无穷多次后,每次试验期望看到的数值。它本身不必是 $X$ 真正能取到的值(比如骰子的 $E(X) = 3.5$)。
For a function $g$ of $X$, the law of the unconscious statistician (LOTUS):
对 $X$ 的函数 $g$,使用无意识统计学家定律(LOTUS):
fair game)。若 $E(\text{net gain}) > 0$,游戏对玩家有利;若 $E(\text{net gain}) < 0$,游戏对庄家(house)有利。IB 应用题几乎总是问"游戏公平吗?"或"赌注定为多少游戏才公平?"两类问题最终都归结为设 $E = 0$ 并求解。
Worked Example — Expected value of a die例题 — 骰子的期望值
Problem: $X$ is the number shown on a fair six-sided die. Find $E(X)$.
Each value $1, 2, \ldots, 6$ has probability $\tfrac{1}{6}$. Apply the definition:
$$ E(X) = \sum_{x=1}^{6} x \cdot \tfrac{1}{6} = \tfrac{1}{6}(1 + 2 + 3 + 4 + 5 + 6) = \tfrac{21}{6} = 3.5. $$So the long-run average roll is $3.5$, even though $3.5$ is never an actual outcome.
题目:$X$ 表示一颗均匀六面骰子掷出的点数。求 $E(X)$。
每个取值 $1, 2, \ldots, 6$ 的概率都是 $\tfrac{1}{6}$。按定义计算:
$$ E(X) = \sum_{x=1}^{6} x \cdot \tfrac{1}{6} = \tfrac{1}{6}(1 + 2 + 3 + 4 + 5 + 6) = \tfrac{21}{6} = 3.5. $$长期平均点数是 $3.5$,尽管骰子永远掷不出 $3.5$ 这个数。
Worked Example — Fair game例题 — 公平游戏
Problem: A carnival game costs $\$3$ to play. You roll a fair die: if you roll a $6$ you win $\$k$, otherwise you win nothing. Find the value of $k$ that makes the game fair.
Let $G$ = net gain. Then $G = k - 3$ with probability $\tfrac{1}{6}$ and $G = -3$ with probability $\tfrac{5}{6}$:
$$ E(G) = \tfrac{1}{6}(k - 3) + \tfrac{5}{6}(-3) = \tfrac{k - 3}{6} - \tfrac{15}{6} = \tfrac{k - 18}{6}. $$Set $E(G) = 0$:
$$ k - 18 = 0 \;\Longrightarrow\; k = 18. $$So the prize must be $\$18$ for the game to be fair.
题目:嘉年华游戏每玩一次收费 $\$3$。你掷一颗均匀骰子:掷到 $6$ 赢得 $\$k$,否则一分不得。求使游戏公平的 $k$。
设 $G$ = 净收益。则 $G = k - 3$ 的概率为 $\tfrac{1}{6}$,$G = -3$ 的概率为 $\tfrac{5}{6}$:
$$ E(G) = \tfrac{1}{6}(k - 3) + \tfrac{5}{6}(-3) = \tfrac{k - 3}{6} - \tfrac{15}{6} = \tfrac{k - 18}{6}. $$令 $E(G) = 0$:
$$ k - 18 = 0 \;\Longrightarrow\; k = 18. $$所以奖金需定为 $\$18$ 才公平。
Worked Example — Insurance例题 — 保险
Problem: An insurer charges a premium of $\$200$ for a one-year policy. The probability that a claim occurs is $0.04$, with payout $\$3000$. Find the insurer's expected profit per policy.
Let $P$ = profit. Then $P = 200$ with probability $0.96$ and $P = 200 - 3000 = -2800$ with probability $0.04$:
$$ E(P) = 0.96(200) + 0.04(-2800) = 192 - 112 = \$80. $$So the insurer expects to make $\$80$ profit on average per policy.
题目:保险公司对一年期保单收取 $\$200$ 保费。出险概率为 $0.04$,理赔金为 $\$3000$。求保险公司每张保单的期望利润。
设 $P$ = 利润。则 $P = 200$ 的概率为 $0.96$,$P = 200 - 3000 = -2800$ 的概率为 $0.04$:
$$ E(P) = 0.96(200) + 0.04(-2800) = 192 - 112 = \$80. $$保险公司平均每张保单期望盈利 $\$80$。
3.3 Variance of a Discrete RV3.3 离散随机变量的方差 AHL 4.11 HL
variance)衡量取值相对于均值的平均平方偏差。两个等价公式,第二个通常更快:
$$ \text{Var}(X) = E\!\left[(X - \mu)^2\right] = E(X^2) - [E(X)]^2. $$
从分布表算出 $E(X^2) = \sum x_i^2\, P(X = x_i)$,把 $E(X)$ 平方,再相减。标准差(standard deviation)$\sigma = \sqrt{\text{Var}(X)}$。
Standard deviation $\sigma = \sqrt{\text{Var}(X)}$. Variance has units of "$X$-squared"; SD has the units of $X$, so SD is what you report.
标准差 $\sigma = \sqrt{\text{Var}(X)}$。方差的单位是"$X$ 的平方";标准差的单位与 $X$ 相同,所以最终汇报时用的是标准差。
▸ Going deeper — Deriving $\text{Var}(X) = E(X^{2}) - \mu^{2}$▸ 深入 — 推导 $\text{Var}(X) = E(X^{2}) - \mu^{2}$
Start from the definition and expand the square:
$$ \text{Var}(X) = E\!\left[(X - \mu)^{2}\right] = E\!\left[X^{2} - 2\mu X + \mu^{2}\right]. $$Linearity of expectation (which we'll prove in 3.8) gives $E(aX + b) = aE(X) + b$. Apply it term by term, remembering that $\mu = E(X)$ is a constant:
$$ = E(X^{2}) - 2\mu\, E(X) + \mu^{2} = E(X^{2}) - 2\mu \cdot \mu + \mu^{2} = E(X^{2}) - \mu^{2}. \;\;\blacksquare $$This is the formula the IB markscheme expects you to use computationally. The other form, $E[(X - \mu)^{2}]$, makes the meaning clearer (average squared deviation) but is slower to evaluate by hand.
从定义出发,把平方展开:
$$ \text{Var}(X) = E\!\left[(X - \mu)^{2}\right] = E\!\left[X^{2} - 2\mu X + \mu^{2}\right]. $$期望的线性性(linearity of expectation,将在 3.8 节证明)给出 $E(aX + b) = aE(X) + b$。逐项使用,注意 $\mu = E(X)$ 是常数:
这就是 IB 评分标准默认你在计算中使用的公式。另一种形式 $E[(X - \mu)^{2}]$ 更直观(平均平方偏差),但手算时慢得多。
Worked Example — Variance from a table例题 — 由分布表求方差
Problem: $X$ has distribution $P(X = 1) = 0.1$, $P(X = 2) = 0.4$, $P(X = 3) = 0.3$, $P(X = 4) = 0.2$. Find $\text{Var}(X)$ and the standard deviation.
First compute $E(X)$:
$$ E(X) = (1)(0.1) + (2)(0.4) + (3)(0.3) + (4)(0.2) = 0.1 + 0.8 + 0.9 + 0.8 = 2.6. $$Then $E(X^{2})$:
$$ E(X^{2}) = (1)(0.1) + (4)(0.4) + (9)(0.3) + (16)(0.2) = 0.1 + 1.6 + 2.7 + 3.2 = 7.6. $$Variance and SD:
$$ \text{Var}(X) = E(X^{2}) - \mu^{2} = 7.6 - (2.6)^{2} = 7.6 - 6.76 = 0.84. $$ $$ \sigma = \sqrt{0.84} \approx 0.917. $$题目:$X$ 的分布为 $P(X = 1) = 0.1$,$P(X = 2) = 0.4$,$P(X = 3) = 0.3$,$P(X = 4) = 0.2$。求 $\text{Var}(X)$ 和标准差。
先算 $E(X)$:
$$ E(X) = (1)(0.1) + (2)(0.4) + (3)(0.3) + (4)(0.2) = 0.1 + 0.8 + 0.9 + 0.8 = 2.6. $$再算 $E(X^{2})$:
$$ E(X^{2}) = (1)(0.1) + (4)(0.4) + (9)(0.3) + (16)(0.2) = 0.1 + 1.6 + 2.7 + 3.2 = 7.6. $$方差与标准差:
$$ \text{Var}(X) = E(X^{2}) - \mu^{2} = 7.6 - (2.6)^{2} = 7.6 - 6.76 = 0.84. $$ $$ \sigma = \sqrt{0.84} \approx 0.917. $$Worked Example — Comparing spreads例题 — 比较离散程度
Problem: $X$ has $P(X = 0) = P(X = 4) = 0.5$. $Y$ has $P(Y = 1) = P(Y = 3) = 0.5$. Both have mean $2$. Compare their variances.
For $X$: $E(X^{2}) = (0)(0.5) + (16)(0.5) = 8$, so $\text{Var}(X) = 8 - 4 = 4$, $\sigma_{X} = 2$.
For $Y$: $E(Y^{2}) = (1)(0.5) + (9)(0.5) = 5$, so $\text{Var}(Y) = 5 - 4 = 1$, $\sigma_{Y} = 1$.
Same mean, very different spreads — $X$'s values are twice as far from the mean on average, and the variance shows it. This is the whole point of variance as a summary statistic.
题目:$X$ 满足 $P(X = 0) = P(X = 4) = 0.5$。$Y$ 满足 $P(Y = 1) = P(Y = 3) = 0.5$。两者均值都是 $2$。比较它们的方差。
对 $X$:$E(X^{2}) = (0)(0.5) + (16)(0.5) = 8$,所以 $\text{Var}(X) = 8 - 4 = 4$,$\sigma_{X} = 2$。
对 $Y$:$E(Y^{2}) = (1)(0.5) + (9)(0.5) = 5$,所以 $\text{Var}(Y) = 5 - 4 = 1$,$\sigma_{Y} = 1$。
均值相同,离散程度差别巨大 — $X$ 的取值平均上离均值的距离是 $Y$ 的两倍,方差恰好把这一点量化出来。这正是方差作为概括统计量的意义所在。
3.4 Binomial Distribution3.4 二项分布 SL 4.8
binomPdf(n, p, k) for $P(X = k)$ and binomCdf(n, p, k) for $P(X \le k)$.
Bernoulli trial)中"成功"的次数,每次试验成功概率为 $p$。
$$ P(X = k) = \binom{n}{k}\, p^{k}\, (1-p)^{n-k}, \quad k = 0, 1, \ldots, n. $$
均值与方差:
$$ E(X) = np, \qquad \text{Var}(X) = np(1 - p). $$
GDC 上用 binomPdf(n, p, k) 计算 $P(X = k)$,用 binomCdf(n, p, k) 计算 $P(X \le k)$。
- Fixed number of trials $n$.
- Two outcomes per trial: success or failure.
- Constant success probability $p$ across trials.
- Independent trials.
- 试验次数 $n$ 固定。
- 每次试验只有两种结果:成功或失败。
- 各次试验的成功概率 $p$ 恒定。
- 各次试验相互独立。
▸ Going deeper — Why $E(X) = np$▸ 深入 — 为什么 $E(X) = np$
Write $X = X_{1} + X_{2} + \cdots + X_{n}$ where $X_{i} = 1$ if trial $i$ is a success and $0$ otherwise. Each $X_{i}$ is a Bernoulli RV with $E(X_{i}) = p$ (since $E(X_{i}) = 1 \cdot p + 0 \cdot (1 - p) = p$). By linearity of expectation (Section 3.8):
$$ E(X) = E(X_{1}) + E(X_{2}) + \cdots + E(X_{n}) = np. $$For variance, each $X_{i}$ has $E(X_{i}^{2}) = p$ (since $X_{i}^{2} = X_{i}$ for a $\{0, 1\}$ variable), so $\text{Var}(X_{i}) = p - p^{2} = p(1 - p)$. The $X_{i}$ are independent, so variances add (Section 3.8):
$$ \text{Var}(X) = n \cdot p(1 - p). $$This decomposition into Bernoulli pieces is the cleanest derivation. It also generalizes immediately: any sum of $n$ independent Bernoulli$(p)$ trials is binomial, regardless of whether they come from "the same experiment."
写 $X = X_{1} + X_{2} + \cdots + X_{n}$,其中第 $i$ 次成功则 $X_{i} = 1$,否则 $X_{i} = 0$。每个 $X_{i}$ 都是伯努利(Bernoulli)随机变量,$E(X_{i}) = p$(因为 $E(X_{i}) = 1 \cdot p + 0 \cdot (1 - p) = p$)。由期望的线性性(见 3.8 节):
对方差,每个 $X_{i}$ 满足 $E(X_{i}^{2}) = p$(取值在 $\{0, 1\}$ 的变量满足 $X_{i}^{2} = X_{i}$),故 $\text{Var}(X_{i}) = p - p^{2} = p(1 - p)$。各 $X_{i}$ 独立,所以方差可加(见 3.8 节):
$$ \text{Var}(X) = n \cdot p(1 - p). $$把二项变量拆成伯努利分量是最干净的推导路线。它还能立刻推广:任意 $n$ 个独立 Bernoulli$(p)$ 试验之和都是二项分布,不管它们是不是来自"同一个实验"。
Worked Example — Exact probability例题 — 精确概率
Problem: A test consists of $10$ multiple-choice questions, each with $4$ options. A student guesses every answer. Find the probability of getting exactly $4$ correct.
$X$ = number of correct answers, $X \sim B(10, 0.25)$. Apply the PMF:
$$ P(X = 4) = \binom{10}{4}\, (0.25)^{4}\, (0.75)^{6}. $$ $$ = 210 \cdot 0.003906 \cdot 0.177979 \approx 0.1460. $$So about $14.6\%$ chance of guessing exactly $4$ correct out of $10$.
题目:一份测验有 $10$ 道选择题,每题 $4$ 个选项。学生全部凭猜作答。求恰好答对 $4$ 题的概率。
设 $X$ = 答对题数,则 $X \sim B(10, 0.25)$。代入概率质量函数(probability mass function / PMF):
所以纯靠猜测在 $10$ 题中恰好做对 $4$ 题的概率约为 $14.6\%$。
Worked Example — Tail probability and GDC routing例题 — 尾部概率与 GDC 路径
Problem: $X \sim B(20, 0.3)$. Find (a) $P(X \le 5)$, (b) $P(X > 8)$, (c) $E(X)$ and $\text{Var}(X)$.
(a) Direct GDC: binomCdf(20, 0.3, 5).
(b) Use complement to fit "$\le$" into the GDC:
$$ P(X > 8) = 1 - P(X \le 8) = 1 - \text{binomCdf}(20, 0.3, 8) \approx 1 - 0.8867 = 0.1133. $$(c) Mean and variance directly from the formulas:
$$ E(X) = 20 \cdot 0.3 = 6, \qquad \text{Var}(X) = 20 \cdot 0.3 \cdot 0.7 = 4.2. $$题目:$X \sim B(20, 0.3)$。求 (a) $P(X \le 5)$,(b) $P(X > 8)$,(c) $E(X)$ 与 $\text{Var}(X)$。
(a) 直接用 GDC:binomCdf(20, 0.3, 5)。
(b) 用补集把"$>$"转换成 GDC 接受的"$\le$":
$$ P(X > 8) = 1 - P(X \le 8) = 1 - \text{binomCdf}(20, 0.3, 8) \approx 1 - 0.8867 = 0.1133. $$(c) 均值与方差直接代公式:
$$ E(X) = 20 \cdot 0.3 = 6, \qquad \text{Var}(X) = 20 \cdot 0.3 \cdot 0.7 = 4.2. $$3.5 Normal Distribution: Properties and Calculations3.5 正态分布:性质与计算 SL 4.9
normCdf(a, b, μ, σ). The GDC wants $\sigma$, not $\sigma^{2}$.
empirical rule):
$$ P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68, $$
$$ P(\mu - 2\sigma \le X \le \mu + 2\sigma) \approx 0.95, $$
$$ P(\mu - 3\sigma \le X \le \mu + 3\sigma) \approx 0.997. $$
Paper 2 用 GDC 的 normCdf(a, b, μ, σ) 计算正态概率。GDC 要求输入的是 $\sigma$,不是 $\sigma^{2}$。
Probability density (background only — IB does not test the PDF formula):
概率密度函数(仅作背景知识 — IB 不会直接考 PDF 公式):
$$ f(x) = \frac{1}{\sigma\sqrt{2\pi}}\, \exp\!\left(-\frac{(x - \mu)^{2}}{2\sigma^{2}}\right) $$For probabilities, use a GDC. Mean $= $ median $= $ mode $= \mu$. Variance $= \sigma^{2}$.
求概率请用 GDC。均值 $= $ 中位数 $= $ 众数 $= \mu$,方差 $= \sigma^{2}$。
- Symmetric about $x = \mu$: $P(X < \mu) = P(X > \mu) = 0.5$.
- Bell-shaped: single peak at $x = \mu$.
- Mean = median = mode = $\mu$.
- Inflection points at $x = \mu \pm \sigma$ (the curve switches from concave-down to concave-up there).
- Total area under the PDF is $1$; tails extend to $\pm\infty$ but probability there is negligible.
- 关于 $x = \mu$ 对称:$P(X < \mu) = P(X > \mu) = 0.5$。
- 呈钟形:在 $x = \mu$ 处取唯一最大值。
- 均值 = 中位数 = 众数 = $\mu$。
- 拐点位于 $x = \mu \pm \sigma$(曲线在此处由凹向下变为凹向上)。
- PDF 下方总面积为 $1$;尾部延伸到 $\pm\infty$,但那里的概率可忽略不计。
Worked Example — Probability between two values例题 — 区间概率
Problem: The heights of adult women in a city are normally distributed with $\mu = 165$ cm and $\sigma = 7$ cm. Find the probability that a randomly chosen woman is between $158$ cm and $172$ cm tall.
$158 = \mu - \sigma$ and $172 = \mu + \sigma$. By the empirical rule:
$$ P(158 \le X \le 172) = P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68. $$Via GDC: normCdf(158, 172, 165, 7) $\approx 0.6827$.
题目:某城市成年女性身高服从正态分布,$\mu = 165$ cm,$\sigma = 7$ cm。求随机抽取一位女性身高在 $158$ cm 到 $172$ cm 之间的概率。
$158 = \mu - \sigma$,$172 = \mu + \sigma$。由经验法则:
$$ P(158 \le X \le 172) = P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68. $$用 GDC:normCdf(158, 172, 165, 7) $\approx 0.6827$。
Worked Example — Tail probability例题 — 尾部概率
Problem: Same setup ($\mu = 165$, $\sigma = 7$). Find $P(X > 180)$.
Use GDC. The upper tail goes to $\infty$, which we represent with a large number like $1\,000$ on the calculator:
$$ P(X > 180) = \text{normCdf}(180, 1000, 165, 7) \approx 0.01618. $$So about $1.6\%$ of adult women are taller than $180$ cm in this city.
题目:沿用上题($\mu = 165$,$\sigma = 7$)。求 $P(X > 180)$。
用 GDC。上尾延伸到 $\infty$,计算器里通常用一个大数(例如 $1\,000$)代替:
$$ P(X > 180) = \text{normCdf}(180, 1000, 165, 7) \approx 0.01618. $$所以这座城市约有 $1.6\%$ 的成年女性高于 $180$ cm。
Worked Example — Probability of a deviation例题 — 偏差概率
Problem: $X \sim N(50, 64)$ (so $\sigma = 8$). Find $P(|X - 50| < 12)$.
$|X - 50| < 12 \Leftrightarrow 38 < X < 62$. So we want $P(38 < X < 62)$:
$$ P(38 \le X \le 62) = \text{normCdf}(38, 62, 50, 8) \approx 0.8664. $$Equivalently, $|Z| < 1.5$ in standardized form (see 3.6).
题目:$X \sim N(50, 64)$(即 $\sigma = 8$)。求 $P(|X - 50| < 12)$。
$|X - 50| < 12 \Leftrightarrow 38 < X < 62$。所以要求的就是 $P(38 < X < 62)$:
$$ P(38 \le X \le 62) = \text{normCdf}(38, 62, 50, 8) \approx 0.8664. $$等价地,在标准化后表示为 $|Z| < 1.5$(见 3.6 节)。
▸ Going deeper — Why are so many real distributions approximately normal?▸ 深入 — 为何现实中那么多分布近似正态?
The Central Limit Theorem says: if $X_{1}, X_{2}, \ldots, X_{n}$ are independent RVs with finite mean and variance, then for large $n$ their sum (and hence their mean) is approximately normal — regardless of the distribution of the individual $X_{i}$.
This is why heights, exam scores, measurement errors, and stock-price log returns all look bell-shaped: each is a sum of many small, roughly-independent contributions (genes, study habits, instrument noise, daily news shocks). The CLT is not on the IB syllabus directly, but it explains why D3 spends so much time on normal — it really is the universal distribution for averages.
The CLT also explains the next section's headline result: a sum of independent normals is itself normal, not just approximately.
中心极限定理(central limit theorem)告诉我们:若 $X_{1}, X_{2}, \ldots, X_{n}$ 是均值和方差都有限的独立随机变量,那么当 $n$ 足够大时,它们的和(以及均值)近似服从正态分布 — 无论单个 $X_{i}$ 本身是什么分布。
这就是为什么身高、考试分数、测量误差、股票对数收益率这些量都呈钟形:每一个都是许多小而近似独立的贡献之和(基因、学习习惯、仪器噪声、每日新闻冲击)。CLT 并非 IB 大纲直接考查内容,但它解释了为什么 D3 花这么大篇幅讲正态 — 正态分布确实是"取平均"这件事的普适分布。
CLT 也是下一节标题结论的根源:独立正态分布之和自身就是正态,并非只是近似。
normCdf(40, 70, 50, 10) $\approx 0.8186$.)正确!标准化:$z_{1} = -1$,$z_{2} = 2$。$P = \Phi(2) - \Phi(-1) \approx 0.9772 - 0.1587 = 0.8185$。(GDC:normCdf(40, 70, 50, 10) $\approx 0.8186$。)normCdf(40, 70, 50, 10) $\approx 0.8186$.$40 = \mu - \sigma$,$70 = \mu + 2\sigma$,所求是 $-1\sigma$ 到 $+2\sigma$ 之间的面积。由对称性约为 $\tfrac{1}{2}(0.68) + \tfrac{1}{2}(0.95) \approx 0.815$;或用 GDC normCdf(40, 70, 50, 10) $\approx 0.8186$。3.6 Inverse Normal & Standardization3.6 反正态与标准化 SL 4.9
invNorm(p, μ, σ). For percentile questions, set $p = $ the percentile (as a decimal). Always sketch the curve and shade the area you want — direction errors are the most common mistake here.
standardization)把任意正态随机变量转换为 $Z \sim N(0, 1)$:
$$ Z = \frac{X - \mu}{\sigma}, \qquad X = \mu + Z\sigma. $$
反正态(inverse normal)走相反方向:给定概率 $p$,求满足 $P(X \le x) = p$ 的值 $x$。GDC 上的命令是 invNorm(p, μ, σ)。求百分位数时,把 $p$ 设为对应百分位(写成小数)。务必先画出正态曲线并标出所求区域 — 方向搞错是这一节最常见的失分点。
The standard normal $Z \sim N(0, 1)$ has $\mu = 0$ and $\sigma = 1$. Any normal probability can be rewritten in terms of $Z$.
标准正态分布 $Z \sim N(0, 1)$ 满足 $\mu = 0$、$\sigma = 1$。任何正态概率都可改写为关于 $Z$ 的形式。
normCdf directly. On Paper 1 (no calculator), you do need to standardize, then read from a (provided) standard normal table. On Paper 3, exam questions often ask you to find $\mu$ or $\sigma$ given a probability: solve $Z = (x - \mu)/\sigma$ for the unknown after using invNorm to get $z$.
Paper 2(可用计算器)不需要标准化 — 直接把 $\mu$、$\sigma$ 输入 normCdf 即可。Paper 1(不可用计算器)必须标准化,然后查附带的标准正态分布表(z-score 表)。Paper 3 经常要求给定概率反求 $\mu$ 或 $\sigma$:先用 invNorm 得到 $z$,再由 $Z = (x - \mu)/\sigma$ 解出未知量。
Worked Example — Standard $z$-scores例题 — 标准 $z$ 分数
Problem: $X \sim N(72, 64)$ ($\sigma = 8$). Convert $X = 80$ and $X = 60$ to $z$-scores.
$$ z_{80} = \frac{80 - 72}{8} = 1, \qquad z_{60} = \frac{60 - 72}{8} = -1.5. $$So $X = 80$ is one standard deviation above the mean; $X = 60$ is $1.5$ SDs below.
题目:$X \sim N(72, 64)$($\sigma = 8$)。把 $X = 80$ 与 $X = 60$ 转换为 $z$ 分数(z-score)。
所以 $X = 80$ 在均值之上 $1$ 个标准差;$X = 60$ 在均值之下 $1.5$ 个标准差。
Worked Example — Inverse normal (percentile)例题 — 反正态(百分位数)
Problem: IQ scores are normally distributed with $\mu = 100$, $\sigma = 15$. Find the IQ that corresponds to the $95$th percentile.
The $95$th percentile is the value $x$ with $P(X \le x) = 0.95$. GDC: invNorm(0.95, 100, 15).
So an IQ of about $125$ marks the top $5\%$.
题目:智商分数服从正态分布,$\mu = 100$,$\sigma = 15$。求第 $95$ 百分位对应的智商。
第 $95$ 百分位即满足 $P(X \le x) = 0.95$ 的值 $x$。GDC:invNorm(0.95, 100, 15)。
所以智商约 $125$ 即可进入前 $5\%$。
Worked Example — Find $\mu$ given a probability例题 — 已知概率反求 $\mu$
Problem: The lifetime $X$ of a lightbulb is normally distributed with unknown mean $\mu$ and known SD $\sigma = 200$ hours. It is known that $5\%$ of bulbs fail before $1\,500$ hours. Find $\mu$.
We are told $P(X < 1500) = 0.05$, so $1\,500$ corresponds to the $5$th percentile. Use invNorm on $Z$:
$$ z_{0.05} = \text{invNorm}(0.05, 0, 1) \approx -1.6449. $$Now apply $z = (x - \mu)/\sigma$:
$$ -1.6449 = \frac{1500 - \mu}{200} \;\Longrightarrow\; \mu = 1500 + 1.6449 \cdot 200 \approx 1828.97. $$So the mean lifetime is about $1\,829$ hours.
题目:灯泡寿命 $X$ 服从正态分布,均值 $\mu$ 未知,标准差 $\sigma = 200$ 小时已知。已知 $5\%$ 的灯泡寿命不足 $1\,500$ 小时。求 $\mu$。
由题 $P(X < 1500) = 0.05$,即 $1\,500$ 是第 $5$ 百分位。先在标准正态上用 invNorm:
$$ z_{0.05} = \text{invNorm}(0.05, 0, 1) \approx -1.6449. $$再代入 $z = (x - \mu)/\sigma$:
$$ -1.6449 = \frac{1500 - \mu}{200} \;\Longrightarrow\; \mu = 1500 + 1.6449 \cdot 200 \approx 1828.97. $$所以平均寿命约为 $1\,829$ 小时。
Worked Example — Find $\sigma$ given a probability例题 — 已知概率反求 $\sigma$
Problem: $X \sim N(50, \sigma^{2})$ and $P(X > 65) = 0.10$. Find $\sigma$.
$P(X > 65) = 0.10 \Rightarrow P(X \le 65) = 0.90$. The corresponding $z$:
$$ z_{0.90} = \text{invNorm}(0.90, 0, 1) \approx 1.2816. $$Apply $z = (65 - 50)/\sigma$:
$$ 1.2816 = \frac{15}{\sigma} \;\Longrightarrow\; \sigma = \frac{15}{1.2816} \approx 11.70. $$题目:$X \sim N(50, \sigma^{2})$,且 $P(X > 65) = 0.10$。求 $\sigma$。
$P(X > 65) = 0.10 \Rightarrow P(X \le 65) = 0.90$,对应的 $z$:
$$ z_{0.90} = \text{invNorm}(0.90, 0, 1) \approx 1.2816. $$代入 $z = (65 - 50)/\sigma$:
$$ 1.2816 = \frac{15}{\sigma} \;\Longrightarrow\; \sigma = \frac{15}{1.2816} \approx 11.70. $$invNorm(p, μ, σ) always returns the value $x$ with $P(X \le x) = p$. If a problem says "$10\%$ of bulbs last more than $X$," then $p = 0.90$ in invNorm, not $0.10$. Always rephrase the question as $P(X \le x) = p$ first.
GDC 的 invNorm(p, μ, σ) 始终返回满足 $P(X \le x) = p$ 的 $x$。若题目说"$10\%$ 的灯泡寿命大于 $X$",则代入 invNorm 时 $p = 0.90$,而不是 $0.10$。动手前先把题目改写成 $P(X \le x) = p$ 的形式。
3.7 Continuous Random Variables and PDFs3.7 连续随机变量与 PDF AHL 4.11 HL
continuous random variable)$X$ 具有概率密度函数(probability density function / PDF)$f(x)$,满足 $f(x) \ge 0$ 且 $\int_{-\infty}^{\infty} f(x)\, dx = 1$。概率就是 PDF 曲线下方的面积:
$$ P(a \le X \le b) = \int_{a}^{b} f(x)\, dx. $$
均值、方差与中位数都用积分表达。最关键的一点:对任意单点 $a$,$P(X = a) = 0$ — 只有区间才具有正概率。所以连续随机变量满足 $P(a \le X \le b) = P(a < X < b)$(与离散情形不同)。
mode)就是使 $f(x)$ 取最大值的 $x$。做法是求导:在定义域上解 $f'(x) = 0$,再用 $f''$ 的符号(或检验端点值)判定极大点。正态分布的众数恰为 $\mu$ — 钟形曲线的最高点。
Worked Example — Solve for the normalising constant例题 — 求归一化常数
Problem: $X$ has PDF $f(x) = c x$ for $0 \le x \le 4$ and $0$ elsewhere. Find $c$, then compute $E(X)$ and $\text{Var}(X)$.
Normalisation:
$$ \int_{0}^{4} c\, x\, dx = c \cdot \tfrac{x^{2}}{2}\Big|_{0}^{4} = 8c = 1 \;\Longrightarrow\; c = \tfrac{1}{8}. $$Mean:
$$ E(X) = \int_{0}^{4} x \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{4} = \tfrac{64}{24} = \tfrac{8}{3} \approx 2.667. $$$E(X^{2})$:
$$ E(X^{2}) = \int_{0}^{4} x^{2} \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{4}}{4}\Big|_{0}^{4} = \tfrac{256}{32} = 8. $$Variance:
$$ \text{Var}(X) = 8 - \left(\tfrac{8}{3}\right)^{2} = 8 - \tfrac{64}{9} = \tfrac{72 - 64}{9} = \tfrac{8}{9} \approx 0.889. $$题目:$X$ 的 PDF 为 $f(x) = c x$($0 \le x \le 4$),其余处取 $0$。求 $c$,并计算 $E(X)$ 与 $\text{Var}(X)$。
归一化:
$$ \int_{0}^{4} c\, x\, dx = c \cdot \tfrac{x^{2}}{2}\Big|_{0}^{4} = 8c = 1 \;\Longrightarrow\; c = \tfrac{1}{8}. $$均值:
$$ E(X) = \int_{0}^{4} x \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{4} = \tfrac{64}{24} = \tfrac{8}{3} \approx 2.667. $$$E(X^{2})$:
$$ E(X^{2}) = \int_{0}^{4} x^{2} \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{4}}{4}\Big|_{0}^{4} = \tfrac{256}{32} = 8. $$方差:
$$ \text{Var}(X) = 8 - \left(\tfrac{8}{3}\right)^{2} = 8 - \tfrac{64}{9} = \tfrac{72 - 64}{9} = \tfrac{8}{9} \approx 0.889. $$Worked Example — Probability over an interval例题 — 区间概率
Problem: Same $X$ with $f(x) = \tfrac{x}{8}$ on $[0, 4]$. Find $P(1 \le X \le 3)$.
$$ P(1 \le X \le 3) = \int_{1}^{3} \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{2}}{2}\Big|_{1}^{3} = \tfrac{1}{16}(9 - 1) = \tfrac{8}{16} = \tfrac{1}{2}. $$题目:沿用上题的 $X$,$f(x) = \tfrac{x}{8}$($x \in [0, 4]$)。求 $P(1 \le X \le 3)$。
$$ P(1 \le X \le 3) = \int_{1}^{3} \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{2}}{2}\Big|_{1}^{3} = \tfrac{1}{16}(9 - 1) = \tfrac{8}{16} = \tfrac{1}{2}. $$Worked Example — Finding the median例题 — 求中位数
Problem: $X$ has PDF $f(x) = \tfrac{3}{8} x^{2}$ for $0 \le x \le 2$. Find the median $m$.
The median $m$ satisfies $\int_{0}^{m} f(x)\, dx = \tfrac{1}{2}$:
$$ \int_{0}^{m} \tfrac{3}{8} x^{2}\, dx = \tfrac{3}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{m} = \tfrac{m^{3}}{8} = \tfrac{1}{2}. $$ $$ m^{3} = 4 \;\Longrightarrow\; m = \sqrt[3]{4} \approx 1.587. $$Note: the median is not the midpoint of the interval $(= 1)$ — this PDF skews probability mass to the right, so the median is bigger than the midpoint.
题目:$X$ 的 PDF 为 $f(x) = \tfrac{3}{8} x^{2}$($0 \le x \le 2$)。求中位数(median)$m$。
中位数 $m$ 满足 $\int_{0}^{m} f(x)\, dx = \tfrac{1}{2}$:
$$ \int_{0}^{m} \tfrac{3}{8} x^{2}\, dx = \tfrac{3}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{m} = \tfrac{m^{3}}{8} = \tfrac{1}{2}. $$ $$ m^{3} = 4 \;\Longrightarrow\; m = \sqrt[3]{4} \approx 1.587. $$注意:中位数不是区间中点($=1$)— 这个 PDF 把概率质量推向右侧,所以中位数比中点要大。
Worked Example — Finding the mode例题 — 求众数
Problem: $X$ has PDF $f(x) = 12 x^{2}(1 - x)$ for $0 \le x \le 1$. Find the mode.
Differentiate and set to zero:
$$ f'(x) = 12\!\left[2x(1 - x) - x^{2}\right] = 12 x (2 - 3 x). $$$f'(x) = 0$ at $x = 0$ or $x = \tfrac{2}{3}$. Endpoint $x = 0$ gives $f = 0$; checking $f'' < 0$ at $x = \tfrac{2}{3}$ confirms a maximum:
$$ \text{mode} = \tfrac{2}{3}. $$题目:$X$ 的 PDF 为 $f(x) = 12 x^{2}(1 - x)$($0 \le x \le 1$)。求众数。
求导并令其为零:
$$ f'(x) = 12\!\left[2x(1 - x) - x^{2}\right] = 12 x (2 - 3 x). $$$f'(x) = 0$ 在 $x = 0$ 或 $x = \tfrac{2}{3}$。端点 $x = 0$ 处 $f = 0$;在 $x = \tfrac{2}{3}$ 处 $f'' < 0$,确认是极大点:
$$ \text{mode} = \tfrac{2}{3}. $$▸ Going deeper — Why $P(X = a) = 0$ for a continuous RV▸ 深入 — 为什么连续随机变量满足 $P(X = a) = 0$
For a continuous RV with PDF $f$, the probability of exactly $X = a$ is
$$ P(X = a) = \int_{a}^{a} f(x)\, dx = 0. $$This is not a quirk — it's the price you pay for using areas instead of point masses. A density assigns probability to intervals, and any single value has interval length $0$. Two consequences worth memorizing for IB:
- For continuous RVs, $P(a \le X \le b) = P(a < X < b) = P(a < X \le b)$. Inequality endpoints don't matter.
- For discrete RVs, $P(X = a) > 0$ in general, and strict vs. weak inequalities do matter (Section 3.4's trap).
This is the deepest reason that the discrete and continuous "languages" are not interchangeable, even though the formulas look symmetric.
对于具有 PDF $f$ 的连续随机变量,"$X$ 恰好等于 $a$"的概率是
$$ P(X = a) = \int_{a}^{a} f(x)\, dx = 0. $$这不是怪现象 — 这是把概率定义成面积(而不是点质量)所必须付出的代价。密度只把概率分配给区间,而任何单点构成的区间长度为零。两个值得记住的 IB 推论:
- 对连续随机变量,$P(a \le X \le b) = P(a < X < b) = P(a < X \le b)$ — 端点的严格/非严格不等号无差别。
- 对离散随机变量,一般 $P(X = a) > 0$,严格不等号与非严格不等号必须区分(即 3.4 节里的陷阱)。
这就是离散与连续两套"语言"形式相似却不能互换的最深层原因。
3.8 Linear Transformations and Sums of RVs3.8 线性变换与随机变量之和 AHL 4.11 · 4.12 · 4.13 HL
linear transformation):
$$ E(aX + b) = a\, E(X) + b, \qquad \text{Var}(aX + b) = a^{2}\, \text{Var}(X). $$
对独立随机变量 $X$、$Y$:
$$ E(X \pm Y) = E(X) \pm E(Y), \qquad \text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y). $$
独立正态分布的线性组合(linear combination)仍服从正态分布 — 新分布的均值与方差由上述规则给出。
$b$ shifts the centre but not the spread; $a$ scales both — quadratically for variance.
$b$ 只平移分布的中心,不改变离散程度;$a$ 同时缩放二者 — 但作用在方差上是平方的关系。
The expectation rule holds without the independence assumption — linearity of expectation is unconditional. The variance rule requires independence.
期望规则不需要独立性假设 — 期望的线性性(linearity of expectation)无条件成立。方差规则则必须依赖独立性。
In particular, $X + Y \sim N(\mu_{1} + \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$ and $X - Y \sim N(\mu_{1} - \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$ — note the plus on the variances even for differences.
特别地,$X + Y \sim N(\mu_{1} + \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$,$X - Y \sim N(\mu_{1} - \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$ — 注意求差时方差仍是相加。
▸ Going deeper — Deriving $\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$▸ 深入 — 推导 $\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$
Let $Y = aX + b$. Apply linearity of expectation to compute the mean:
$$ E(Y) = E(aX + b) = a E(X) + b = a\mu + b. $$Now apply the definition of variance:
$$ \text{Var}(Y) = E\!\left[(Y - E(Y))^{2}\right] = E\!\left[(aX + b - a\mu - b)^{2}\right] = E\!\left[(a(X - \mu))^{2}\right]. $$Factor out the $a^{2}$ (which is a constant):
$$ = a^{2}\, E\!\left[(X - \mu)^{2}\right] = a^{2}\, \text{Var}(X). \;\;\blacksquare $$Two takeaways: the shift $b$ disappears (variance is translation-invariant — spread doesn't care where you measure from), and the scale factor $a$ enters squared (because squaring is what made variance non-negative in the first place). The fact that $|a|$ matters but $\text{sign}(a)$ doesn't is also a useful cross-check: $\text{Var}(-X) = \text{Var}(X)$.
设 $Y = aX + b$。用期望的线性性算出均值:
$$ E(Y) = E(aX + b) = a E(X) + b = a\mu + b. $$再代入方差的定义:
$$ \text{Var}(Y) = E\!\left[(Y - E(Y))^{2}\right] = E\!\left[(aX + b - a\mu - b)^{2}\right] = E\!\left[(a(X - \mu))^{2}\right]. $$把常数 $a^{2}$ 提到期望外面:
$$ = a^{2}\, E\!\left[(X - \mu)^{2}\right] = a^{2}\, \text{Var}(X). \;\;\blacksquare $$两点要记:常数项 $b$ 完全消失(方差具有平移不变性 — 离散程度与"从哪测量"无关);缩放因子 $a$ 进入时是平方(因为正是平方运算才让方差非负)。一个有用的交叉验证:只有 $|a|$ 重要、$\text{sign}(a)$ 无关紧要,即 $\text{Var}(-X) = \text{Var}(X)$。
▸ Going deeper — Why $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$ for independent RVs▸ 深入 — 为什么独立随机变量满足 $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$
Expand using the alternate variance formula and the fact that for independent RVs $E(XY) = E(X)E(Y)$ (this is the algebraic definition of independence used by IB at HL):
$$ \text{Var}(X + Y) = E\!\left[(X + Y)^{2}\right] - [E(X + Y)]^{2}. $$Expand the square inside the first expectation:
$$ = E(X^{2}) + 2 E(XY) + E(Y^{2}) - [E(X) + E(Y)]^{2}. $$Independence kicks in on $E(XY) = E(X)\, E(Y)$. The squared mean expands as $[E(X)]^{2} + 2 E(X) E(Y) + [E(Y)]^{2}$, so the $2 E(XY)$ and the $-2 E(X) E(Y)$ cancel exactly:
$$ = \!\left[E(X^{2}) - [E(X)]^{2}\right] + \!\left[E(Y^{2}) - [E(Y)]^{2}\right] = \text{Var}(X) + \text{Var}(Y). \;\;\blacksquare $$For $\text{Var}(X - Y)$, write $X - Y = X + (-Y)$ and use $\text{Var}(-Y) = (-1)^{2}\text{Var}(Y) = \text{Var}(Y)$, so variances still add. Variance always adds for independent RVs, even when the RVs are subtracted. This is the result IB tests most often.
使用方差的另一种形式,并利用独立随机变量满足 $E(XY) = E(X)E(Y)$(IB HL 把这条作为独立性的代数定义):
$$ \text{Var}(X + Y) = E\!\left[(X + Y)^{2}\right] - [E(X + Y)]^{2}. $$展开第一项里的平方:
$$ = E(X^{2}) + 2 E(XY) + E(Y^{2}) - [E(X) + E(Y)]^{2}. $$独立性出现在 $E(XY) = E(X)\, E(Y)$。把均值的平方展开成 $[E(X)]^{2} + 2 E(X) E(Y) + [E(Y)]^{2}$,则 $2 E(XY)$ 与 $-2 E(X) E(Y)$ 恰好抵消:
$$ = \!\left[E(X^{2}) - [E(X)]^{2}\right] + \!\left[E(Y^{2}) - [E(Y)]^{2}\right] = \text{Var}(X) + \text{Var}(Y). \;\;\blacksquare $$对于 $\text{Var}(X - Y)$,写成 $X - Y = X + (-Y)$,再用 $\text{Var}(-Y) = (-1)^{2}\text{Var}(Y) = \text{Var}(Y)$,方差依然相加。独立随机变量的方差永远相加,即使两个变量是相减的。这是 IB 考得最多的一条结论。
Worked Example — Linear transformation例题 — 线性变换
Problem: $X$ has $E(X) = 10$ and $\text{Var}(X) = 4$. Let $Y = 3X - 5$. Find $E(Y)$ and $\text{Var}(Y)$.
$$ E(Y) = 3 \cdot 10 - 5 = 25, \qquad \text{Var}(Y) = 3^{2} \cdot 4 = 36. $$So $\sigma_{Y} = 6$ (three times $\sigma_{X} = 2$, since scale $a = 3$ multiplies SD by $|a|$).
题目:$X$ 满足 $E(X) = 10$、$\text{Var}(X) = 4$。设 $Y = 3X - 5$。求 $E(Y)$ 与 $\text{Var}(Y)$。
$$ E(Y) = 3 \cdot 10 - 5 = 25, \qquad \text{Var}(Y) = 3^{2} \cdot 4 = 36. $$所以 $\sigma_{Y} = 6$(恰为 $\sigma_{X} = 2$ 的三倍,因为缩放因子 $a = 3$ 把标准差乘以 $|a|$)。
Worked Example — Sum of independent RVs例题 — 独立随机变量之和
Problem: $X$ and $Y$ are independent with $E(X) = 5$, $\text{Var}(X) = 9$, $E(Y) = 3$, $\text{Var}(Y) = 16$. Find $E(2X - Y + 4)$ and $\text{Var}(2X - Y + 4)$.
$$ E(2X - Y + 4) = 2 \cdot 5 - 3 + 4 = 11. $$ $$ \text{Var}(2X - Y + 4) = 2^{2}\, \text{Var}(X) + (-1)^{2}\, \text{Var}(Y) = 4 \cdot 9 + 1 \cdot 16 = 52. $$The constant $+4$ shifts the mean but does not change the variance. The minus sign on $Y$ doesn't change its variance contribution either — variances always add for independent RVs.
题目:$X$、$Y$ 独立,且 $E(X) = 5$、$\text{Var}(X) = 9$、$E(Y) = 3$、$\text{Var}(Y) = 16$。求 $E(2X - Y + 4)$ 与 $\text{Var}(2X - Y + 4)$。
$$ E(2X - Y + 4) = 2 \cdot 5 - 3 + 4 = 11. $$ $$ \text{Var}(2X - Y + 4) = 2^{2}\, \text{Var}(X) + (-1)^{2}\, \text{Var}(Y) = 4 \cdot 9 + 1 \cdot 16 = 52. $$常数项 $+4$ 平移均值,但不改变方差。$Y$ 前的负号也不影响其对方差的贡献 — 独立随机变量的方差始终相加。
Worked Example — Sum of independent normals例题 — 独立正态之和
Problem: $X \sim N(20, 4)$ and $Y \sim N(15, 9)$ are independent. Find $P(X + Y > 40)$ and $P(X > Y)$.
By 4.13, $X + Y \sim N(20 + 15,\; 4 + 9) = N(35, 13)$, so $\sigma = \sqrt{13} \approx 3.606$.
$$ P(X + Y > 40) = \text{normCdf}(40, 1000, 35, \sqrt{13}) \approx 0.0828. $$For $P(X > Y)$, rewrite as $P(X - Y > 0)$. Then $X - Y \sim N(20 - 15,\; 4 + 9) = N(5, 13)$ — note the plus on the variances:
$$ P(X - Y > 0) = \text{normCdf}(0, 1000, 5, \sqrt{13}) \approx 0.9172. $$题目:$X \sim N(20, 4)$,$Y \sim N(15, 9)$,相互独立。求 $P(X + Y > 40)$ 与 $P(X > Y)$。
由 4.13,$X + Y \sim N(20 + 15,\; 4 + 9) = N(35, 13)$,所以 $\sigma = \sqrt{13} \approx 3.606$。
$$ P(X + Y > 40) = \text{normCdf}(40, 1000, 35, \sqrt{13}) \approx 0.0828. $$对 $P(X > Y)$,改写为 $P(X - Y > 0)$。则 $X - Y \sim N(20 - 15,\; 4 + 9) = N(5, 13)$ — 注意方差仍取加号:
$$ P(X - Y > 0) = \text{normCdf}(0, 1000, 5, \sqrt{13}) \approx 0.9172. $$Worked Example — Mean of $n$ independent normals例题 — $n$ 个独立正态的均值
Problem: A factory weighs apples. Individual weights $X_{i} \sim N(150, 100)$ (so $\sigma = 10$ g) and weights are independent. A box contains $9$ apples. Find the distribution of the sample mean $\bar{X} = \tfrac{1}{9}\sum_{i=1}^{9} X_{i}$ and compute $P(\bar{X} > 154)$.
By the 4.13 rule with $a_{i} = \tfrac{1}{9}$ for each of $9$ terms:
$$ E(\bar{X}) = \tfrac{1}{9} \cdot 9 \cdot 150 = 150. $$ $$ \text{Var}(\bar{X}) = \tfrac{1}{81} \cdot 9 \cdot 100 = \tfrac{100}{9}. $$So $\bar{X} \sim N(150, \tfrac{100}{9})$, with $\sigma_{\bar{X}} = \tfrac{10}{3} \approx 3.33$ — one-third the individual SD, as expected.
$$ P(\bar{X} > 154) = \text{normCdf}(154, 1000, 150, 10/3) \approx 0.1151. $$Compare to $P(X_{1} > 154) = \text{normCdf}(154, 1000, 150, 10) \approx 0.3446$ — averaging makes large deviations much less likely.
题目:一家工厂称量苹果。每个苹果的重量 $X_{i} \sim N(150, 100)$(即 $\sigma = 10$ g),各苹果之间独立。一盒装 $9$ 个苹果。求样本均值 $\bar{X} = \tfrac{1}{9}\sum_{i=1}^{9} X_{i}$ 的分布,并计算 $P(\bar{X} > 154)$。
用 4.13 的规则,每一项的系数 $a_{i} = \tfrac{1}{9}$,共 $9$ 项:
$$ E(\bar{X}) = \tfrac{1}{9} \cdot 9 \cdot 150 = 150. $$ $$ \text{Var}(\bar{X}) = \tfrac{1}{81} \cdot 9 \cdot 100 = \tfrac{100}{9}. $$所以 $\bar{X} \sim N(150, \tfrac{100}{9})$,$\sigma_{\bar{X}} = \tfrac{10}{3} \approx 3.33$ — 正好是单个苹果标准差的三分之一,符合预期。
$$ P(\bar{X} > 154) = \text{normCdf}(154, 1000, 150, 10/3) \approx 0.1151. $$对比 $P(X_{1} > 154) = \text{normCdf}(154, 1000, 150, 10) \approx 0.3446$ — 取平均后,大偏差的概率明显下降。
2. Subtracting variances. $\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y)$ for independent RVs, always. Variances never subtract.
3. Using the independence-only variance rule without independence. If $X$ and $Y$ are correlated, $\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X, Y)$. The IB doesn't test covariance, but it does sometimes test recognising that two RVs are not independent — read the problem carefully. 1. 缩放方差时忘记把系数平方:$\text{Var}(2X) = 4\,\text{Var}(X)$,不是 $2\,\text{Var}(X)$。
2. 把方差相减。独立随机变量始终满足 $\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y)$ — 方差从不相减。
3. 没有独立性却套用独立性方差规则。若 $X$、$Y$ 相关,则 $\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X, Y)$。IB 不直接考协方差(
covariance),但偶尔会让你判定两个随机变量是否独立 — 读题要仔细。
Exam Strategy & Common Pitfalls考试策略与常见陷阱
- $E(X) = \sum x_i\, P(X = x_i)$ for discrete RVs
- $\text{Var}(X) = E(X^{2}) - \mu^{2}$ HL
- Binomial: $P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$, mean $np$, var $np(1-p)$
- Standardization $Z = (X - \mu)/\sigma$ and $X = \mu + Z\sigma$
- $68$/$95$/$99.7$ empirical rule
- Continuous: $\int f = 1$, $E(X) = \int x f$, median is the $50\%$-area split HL
- $E(aX + b) = aE(X) + b$, $\text{Var}(aX + b) = a^{2}\text{Var}(X)$ HL
- Sum of indep. normals: means add, variances add (even for differences) HL
- 离散随机变量:$E(X) = \sum x_i\, P(X = x_i)$
- $\text{Var}(X) = E(X^{2}) - \mu^{2}$ HL
- 二项分布:$P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$,均值 $np$,方差 $np(1-p)$
- 标准化 $Z = (X - \mu)/\sigma$ 与反向公式 $X = \mu + Z\sigma$
- $68$/$95$/$99.7$ 经验法则
- 连续:$\int f = 1$,$E(X) = \int x f$,中位数为面积均分点 HL
- $E(aX + b) = aE(X) + b$,$\text{Var}(aX + b) = a^{2}\text{Var}(X)$ HL
- 独立正态之和:均值相加,方差也相加(求差时同样相加) HL
- Why $E(X)$ doesn't need to be a value $X$ can take
- Why variance squares deviations rather than absolute-valuing them HL
- The four binomial conditions and when they fail
- Why GDC uses $\sigma$, not $\sigma^{2}$ — even though IB writes $N(\mu, \sigma^{2})$
- Why $P(X = a) = 0$ for continuous RVs HL
- Variance always adds for independent RVs, even on a difference HL
- Why normals are closed under linear combinations HL
- $E(X)$ 为什么不必是 $X$ 真正能取到的值
- 方差为什么要把偏差平方而不是取绝对值 HL
- 二项分布的四个条件及它们何时失效
- 为什么 GDC 接受 $\sigma$ 而非 $\sigma^{2}$ — 尽管 IB 写作 $N(\mu, \sigma^{2})$
- 为什么连续随机变量满足 $P(X = a) = 0$ HL
- 独立随机变量的方差始终相加,求差时也一样 HL
- 正态分布为何在线性组合下封闭 HL
Common Pitfalls常见陷阱
2. Strict vs. weak inequality on a discrete RV: $P(X < k) \ne P(X \le k)$ for binomial.
3. Confusing $\sigma$ and $\sigma^{2}$ in $N(\mu, \sigma^{2})$ — feeding $\sigma^{2}$ into the GDC's
normCdf.4. "Top $10\%$" with invNorm: forgetting to use $p = 0.90$ rather than $0.10$.
5. Subtracting variances on $X - Y$. Variances always add for independent RVs.
6. Forgetting to square the scale factor: $\text{Var}(2X) = 4\,\text{Var}(X)$, not $2\,\text{Var}(X)$.
7. Using a binomial when independence fails — sampling without replacement from a small population.
8. Forgetting the $1 - F(k - 1)$ off-by-one for $P(X \ge k)$ on a discrete CDF.
9. Writing $P(X = a) > 0$ for a continuous RV — it's always $0$. 1. 算方差时把 $E(X^{2}) - \mu^{2}$ 写成 $E(X^{2}) - E(X)$。
2. 离散随机变量的严格/非严格不等号:二项分布 $P(X < k) \ne P(X \le k)$。
3. 把 $N(\mu, \sigma^{2})$ 里的 $\sigma$ 与 $\sigma^{2}$ 混淆 — 错把 $\sigma^{2}$ 输入 GDC 的
normCdf。4. "前 $10\%$"用 invNorm 时忘了用 $p = 0.90$ 而非 $0.10$。
5. 在 $X - Y$ 上把方差相减。独立随机变量的方差始终相加。
6. 忘记把缩放系数平方:$\text{Var}(2X) = 4\,\text{Var}(X)$,不是 $2\,\text{Var}(X)$。
7. 独立性不成立时仍套用二项分布 — 从小总体中不放回抽样就是典型情形。
8. 求离散 CDF 上的 $P(X \ge k)$ 时漏掉"差一",写错 $1 - F(k - 1)$。
9. 给连续随机变量写 $P(X = a) > 0$ — 它永远是 $0$。
Paper 2 (calc): All binomial and normal calculations — $P(X = k)$, $P(X \le k)$, inverse normal, find $\mu$ or $\sigma$ given a probability. The GDC does the arithmetic; you do the routing.
Paper 3 (HL, calc): Continuous PDFs, multi-step normal problems, sums of independent normals. Often: define a new RV, find its distribution by 4.13, then compute a probability. HL Paper 1(不可计算器):纯代数 — 证明 $\text{Var}(X) = E(X^{2}) - \mu^{2}$,应用 $E(aX + b)$ 与 $\text{Var}(aX + b)$,从小表算 $E(X)$,用所给 $z$ 表做标准化。
Paper 2(可计算器):全部二项分布与正态分布计算 — $P(X = k)$、$P(X \le k)$、反正态、由概率反求 $\mu$ 或 $\sigma$。算术由 GDC 完成,你负责"翻译"题目。
Paper 3(HL,可计算器):连续 PDF、多步骤正态题、独立正态之和。常见套路:先定义新随机变量,再由 4.13 算出它的分布,最后求概率。 HL
Flashcards闪卡
$P(|X - \mu| \le 2\sigma) \approx 0.95$
$P(|X - \mu| \le 3\sigma) \approx 0.997$
Unit D3 — Practice QuizD3 单元 — 练习测验
Ten mixed-difficulty items, with at least three HL-only items clearly tagged. Your score updates in real time at the top of the page. Aim for 8/10 before exam day.
共 10 道难度混合题,其中至少 3 道为 HL 专属题(已明确标注)。分数会实时显示在页面顶端。考前目标:8/10 以上。
normCdf(85, 130, 100, 15).$85 = \mu - \sigma$,$130 = \mu + 2\sigma$。$-1\sigma$ 到 $+2\sigma$ 之间的面积 $\approx 0.819$,用 GDC normCdf(85, 130, 100, 15)。normCdf(24, 1000, 20, 3) $\approx 0.0912$.正确!$X + Y \sim N(12 + 8, 4 + 5) = N(20, 9)$,故 $\sigma = 3$。$P(X + Y > 24) = $ normCdf(24, 1000, 20, 3) $\approx 0.0912$。Readiness Checklist备考清单
Click each item you've mastered. Aim for 100% before exam day. Items marked HL are HL-only.
每掌握一条就点击它。目标是考前 100% 达成。带 HL 标记的项目仅 HL 学生需要掌握。
- SL 4.7 I can identify a discrete random variable, tabulate its distribution, and verify $\sum P = 1$.能识别一个离散随机变量,列出它的分布表,并核对 $\sum P = 1$。
- SL 4.7 I can compute $E(X) = \sum x_i\, P(X = x_i)$ from a table and interpret it as the long-run mean.能从分布表算出 $E(X) = \sum x_i\, P(X = x_i)$,并理解它是长期平均值。
- SL 4.7 I can solve "fair-game" problems by setting $E(\text{net gain}) = 0$.能用 $E(\text{net gain}) = 0$ 解决"公平游戏"类问题。
- SL 4.8 I can recognise the four binomial conditions and state $X \sim B(n, p)$ correctly.能辨识二项分布的四个条件,并正确写出 $X \sim B(n, p)$。
- SL 4.8 I can compute exact and tail binomial probabilities, including using the complement for $P(X \ge k)$.能计算二项分布的精确概率与尾部概率,包括用补集处理 $P(X \ge k)$。
- SL 4.8 I know $E(X) = np$ and $\text{Var}(X) = np(1-p)$ for binomial.能记住二项分布的 $E(X) = np$ 与 $\text{Var}(X) = np(1-p)$。
- SL 4.9 I can state the properties of $X \sim N(\mu, \sigma^{2})$ and use the $68$/$95$/$99.7$ rule.能陈述 $X \sim N(\mu, \sigma^{2})$ 的性质,并运用 $68$/$95$/$99.7$ 法则。
- SL 4.9 I can compute normal probabilities by GDC (
normCdf) and standardize using $Z = (X - \mu)/\sigma$.能用 GDC 的normCdf计算正态概率,并用 $Z = (X - \mu)/\sigma$ 做标准化。 - SL 4.9 I can use inverse normal to find percentiles and to solve for an unknown $\mu$ or $\sigma$ given a probability.能用反正态求百分位数,也能在已知概率的情况下反求未知的 $\mu$ 或 $\sigma$。
- HL AHL 4.11 I can compute $\text{Var}(X) = E(X^{2}) - \mu^{2}$ for a discrete RV and reproduce the algebraic derivation.能对离散随机变量算出 $\text{Var}(X) = E(X^{2}) - \mu^{2}$,并重现它的代数推导。
- HL AHL 4.11 I can verify a PDF, compute probabilities, $E(X)$, $\text{Var}(X)$, mode and median by integration.能验证一个 PDF,并通过积分算出概率、$E(X)$、$\text{Var}(X)$、众数与中位数。
- HL AHL 4.11 I can apply $E(aX + b) = aE(X) + b$ and $\text{Var}(aX + b) = a^{2}\text{Var}(X)$, and explain why the constant disappears in the variance.能运用 $E(aX + b) = aE(X) + b$ 与 $\text{Var}(aX + b) = a^{2}\text{Var}(X)$,并解释为什么常数项在方差里消失。
- HL AHL 4.12 I can use $E(X \pm Y) = E(X) \pm E(Y)$ and (for independent RVs) $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$ — including remembering that variances add on a difference.能运用 $E(X \pm Y) = E(X) \pm E(Y)$,以及(独立随机变量的)$\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$ — 牢记求差时方差仍相加。
- HL AHL 4.13 I can identify the distribution of a linear combination of independent normals and use it to compute probabilities of sums, differences, and sample means.能识别独立正态的线性组合的分布,并用它计算和、差与样本均值的概率。
IB Paper-Style PracticeIB 试卷风格练习
IB exam-style questions across Paper 1A (short response, no calc), Paper 1B (extended response, no calc), Paper 2 (calculator), and Paper 3 HL extended exploration. HL-only material (variance, continuous PDFs, linear combinations of RVs) is flagged. EMH difficulty mix. Mark-by-mark solutions live in the separate solutions file. Use this after the in-page quiz and flashcards.
IB 考试风格题,涵盖 Paper 1A(短答,无计算器)、Paper 1B(长答,无计算器)、Paper 2(可用计算器),以及 Paper 3 HL 长题探究。HL 专属内容(方差、连续 PDF、随机变量的线性组合)已标注。难度按 EMH 分级。逐分解答见独立的解答文档。建议在做完本页测验与闪卡后再来。